package com.hightrast.service.compareToData.stage.impl;

import com.hightrast.service.api.entity.RastOrders;
import com.hightrast.service.compareToData.stage.EntityUpdater;
import com.hightrast.service.util.BaseEntityUtil;

/**
 *  订单 更新策略实现
 */
public class RastOrderUpdater implements EntityUpdater<RastOrders> {
    @Override
    public void updateEntity(RastOrders oldEntity, RastOrders newEntity) {
        oldEntity.setClosedAt(newEntity.getClosedAt());
        oldEntity.setUpdatedAt(newEntity.getUpdatedAt());
        oldEntity.setTotalPrice(newEntity.getTotalPrice());
        oldEntity.setSubtotalPrice(newEntity.getSubtotalPrice());
        oldEntity.setTotalTax(newEntity.getTotalTax());
        oldEntity.setFinancialStatus(newEntity.getFinancialStatus());
        oldEntity.setConfirmed(newEntity.getConfirmed());
        oldEntity.setTotalDiscounts(newEntity.getTotalDiscounts());
        oldEntity.setTotalLineItemsPrice(newEntity.getTotalLineItemsPrice());
        oldEntity.setName(newEntity.getName());
        oldEntity.setOrderNumber(newEntity.getOrderNumber());
        oldEntity.setCurrentTotalPrice(newEntity.getCurrentTotalPrice());
        oldEntity.setTotalOutstanding(newEntity.getTotalOutstanding());
        oldEntity.setCurrentSubtotalPrice(newEntity.getCurrentSubtotalPrice());
        oldEntity.setFulfillmentStatus(newEntity.getFulfillmentStatus());
        BaseEntityUtil.update(oldEntity);
    }
}